﻿@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model EntityModel.Product
@using (Html.BeginForm("Edit", "Product", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <table class="inputTable">
        <tbody>
            <tr>
                <th>
                    产品名称:
                    <input type="hidden" id="Id" name="Id" class="formInput"  value="@Model.Id"/>
                </th>
                <td>
                    <input type="text" id="Name" name="Name" class="formInput"  value="@Model.Name"/>
                </td>
            </tr>
            <tr>
                <th>
                    短链接:
                </th>
                <td>
                    <input type="text" id="ShortUrl" name="ShortUrl" class="formInput" value="@Model.ShortUrl" />
                </td>
            </tr>
            <tr>
                <th>
                    SKU:
                </th>
                <td>
                    <input type="text" id="SKU" name="SKU" class="formInput" value="@Model.Sku" />
                </td>
            </tr>
            <tr>
                <th>
                    所属分类:
                </th>
                <td>
                    @Html.DropDownList("CategoryId", ViewData["category"] as SelectList, "--请选择--", new { @class = "formInput" })
                </td>
            </tr>
            <tr>
                <th>
                    所属品牌:
                </th>
                <td>
                    @Html.DropDownList("BrandId", ViewData["brand"] as SelectList, "--请选择--", new { @class = "formInput" })
                </td>
            </tr>
            <tr>
                <th>
                    零售价:
                </th>
                <td>
                    <input type="text" id="SalePrice" name="SalePrice" class="formInput" value="@Model.SalePrice" />
                </td>
            </tr>
            <tr>
                <th>
                    成本价:
                </th>
                <td>
                    <input type="text" id="CostPrice" name="CostPrice" class="formInput"  value="@Model.CostPrice"/>
                </td>
            </tr>
            <tr>
                <th>
                    库存数量:
                </th>
                <td>
                    <input type="text" id="Quantity" name="Quantity" class="formInput" value="@Model.Quantity" />
                </td>
            </tr>
            <tr>
                <th>
                    显示区域:
                </th>
                <td>
                    <table>
                        <tr>
                            <td>
                                热卖产品：
                                @Html.CheckBox("IsHot", false, new { value = "热卖产品" })
                            </td>
                            <td>
                                新品上架：
                                @Html.CheckBox("IsNew", false, new { value = "热卖产品" })
                            </td>
                            <td>
                                特价产品：
                                @Html.CheckBox("IsPrice", false, new { value = "热卖产品" })
                            </td>
                            <td>
                                店长推荐：
                                @Html.CheckBox("IsRecommend", false, new { value = "热卖产品" })
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <th>
                    排列顺序:
                </th>
                <td>
                    <input type="text" id="DisplayOrder" name="DisplayOrder" class="formInput" value="@Model.DisplayOrder" />
                </td>
            </tr>
            <tr>
                <th>
                    使用方法:
                </th>
                <td>
                    @Html.DropDownList("MethodId", ViewData["method"] as SelectList, "--请选择--", new { @class = "formInput" })
                </td>
            </tr>
            <tr>
                <th>
                    是否包邮:
                </th>
                <td>
                    包邮：@Html.CheckBox("IsPost", false, new { value = "" })
                </td>
            </tr>
            <tr>
                <th>
                    页面关键词:
                </th>
                <td>
                    <input type="text" name="MetaKeywords" class="formTextarea" value="@Model.MetaKeywords">
                </td>
            </tr>
            <tr>
                <th>
                    页面描述:
                </th>
                <td>
                    <textarea name="MetaDescription" class="formTextarea" >@Model.MetaDescription</textarea>
                </td>
            </tr>
            <tr>
                <th>
                    产品描述:
                </th>
                <td>
                  <input type="hidden" name="hidContents" id="hidContents" value="@(Model.Contents)" />
                    <script type="text/javascript" src="/FCKEditorSimpleNet265/fckeditor.js"></script>
                    <script type="text/javascript">
                        var oFCKeditor = new FCKeditor('Contents');
                        oFCKeditor.BasePath = '/FCKEditorSimpleNet265/';
                        oFCKeditor.ToolbarSet = 'YouLanYe';
                        oFCKeditor.Width = '100%';
                        oFCKeditor.Height = '520px';
                        oFCKeditor.Value = $("#hidContents").val();
                        oFCKeditor.Create(); 
                    </script>
                </td>
            </tr>
            <tr>
                <th>
                    &nbsp;
                </th>
                <td>
                    <input id="btnOK" type="submit" class="formButton" value="保 存" />
                </td>
            </tr>
        </tbody>
    </table>
    
}
